<template>
  <div class="repair_state">
    <span class="block_label_color small_label" :class="repairStatusColor">{{data.repairStatusLabel}}</span>
  </div>
</template>

<script>
export default {
  name: 'RepairStatus',
  props: {
    data: Object
  },
  computed: {
    // 根据维修状态返回相应class
    repairStatusColor() {
      switch (this.data.repairStatusValue) {
        case 'InProcessing':
          // 维修中
          return 'state_inProcessing'
        case 'Finished':
          // 已维修
          return 'state_finished'
        default:
          return ''
      }
    }
  }
}
</script>

<style scoped lang="less">
  /* 维修状态颜色 */
  // 维修中
  @stateInProcessing: #ff931f;
  // 已维修
  @stateFinished: #7e8e9f;
  .repair_state{
    .block_label_color{
      /*维修状态*/
      // 维修中
      &.state_inProcessing{
        background-color: @stateInProcessing;
      }
      // 已维修
      &.state_finished{
        background-color: @stateFinished;
      }
    }
  }
</style>
